Skip to content

refactor: enforce GUI→Logic→Database layer separation #61

Merged
merged 1 commit into from
Apr 8, 2026

Conversation

francinv
Copy link
Member

@francinv francinv commented Apr 6, 2026

Closes #55

Route all database calls through state classes instead of calling DatabaseManager directly from screen helpers.

Route all database calls through state classes instead of calling
DatabaseManager directly from screen helpers.

- LobbyState: add validateLobby, listenForOpponentReady, startGame,
  listenForGameStart wrapper methods
- SetupState: add confirmSetup, unconfirmSetup, listenForBothSetupReady,
  getOpponentBoard, getFirebaseApi wrapper methods
- LobbyValidator: route through LobbyState instead of DatabaseManager
- LobbyFlowController: route through LobbyState
- SetupFlowController: route through SetupState
- GameNetworkHandler: accept FirebaseAPI via constructor injection
- Thread LobbyState through MainMenuScreen→MainMenuUI→JoinGamePanel
- Thread FirebaseAPI through SetupScreen→GameScreen→GameNetworkHandler

Result: zero DatabaseManager references in screens/ package
@francinv francinv requested review from benjamls and jonasew April 6, 2026 21:18
@francinv francinv self-assigned this Apr 6, 2026
@jonasew jonasew merged commit 6f7771f into development Apr 8, 2026
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants